package redis

import (
	gredis "github.com/garyburd/redigo/redis"
)

//BITCOUNT key [start end]
func (r *RedisPool) BitCount(key string, args ...interface{}) (int, error) {
	var tmp []interface{}
	tmp = append(tmp, key)
	tmp = append(tmp, args...)
	return gredis.Int(r.Do("BITCOUNT", tmp...))
}

//GETBIT key offset
func (r *RedisPool) GetBit(key string, offset int) (int, error) {
	return gredis.Int(r.Do("GETBIT", key, offset))
}

//SETBIT key offset value
func (r *RedisPool) SetBit(key string, offset int, value int) (int, error) {
	return gredis.Int(r.Do("SETBIT", key, offset, value))
}
